import { Injectable } from '@angular/core';

import { Observable } from 'rxjs';

import { HttpRequestService } from '../../core/services/http-request.service';

@Injectable()
export class TimeZoneService {
    constructor(private httpRequestService: HttpRequestService) { }

    loadGender(): Observable<any[]> {
        return this.httpRequestService.getWithoutBaseUrl<any[]>('assets/demo-data/gender.json');
    }

    loadTimeZones(): Observable<any[]> {
        return this.httpRequestService.getWithoutBaseUrl<any[]>('assets/demo-data/time-zones.json');
    }

    loadAlaskanTimeZoneState(): Observable<any[]> {
        return this.httpRequestService.getWithoutBaseUrl<any[]>('assets/demo-data/alaskan-time-zone-state.json');
    }

    loadPacificTimeZoneState(): Observable<any[]> {
        return this.httpRequestService.getWithoutBaseUrl<any[]>('assets/demo-data/pacific-time-zone-state.json');
    }

    loadMountainTimeZoneState(): Observable<any[]> {
        return this.httpRequestService.getWithoutBaseUrl<any[]>('assets/demo-data/mountain-time-zone-state.json');
    }

    loadCentralTimeZoneState(): Observable<any[]> {
        return this.httpRequestService.getWithoutBaseUrl<any[]>('assets/demo-data/central-time-zone-state.json');
    }

    loadEasternZoneState(): Observable<any[]> {
        return this.httpRequestService.getWithoutBaseUrl<any[]>('assets/demo-data/eastern-time-zone-state.json');
    }

    trackByTimeZone(index: number, timeZone: any): number {
        return timeZone.id;
    }
}